package com.dinggou.shopjb.adapters;

import android.content.Context;
import android.widget.TextView;

import com.dinggou.shopjb.R;
import com.dinggou.shopjb.base.BaseRVAdapter;
import com.dinggou.shopjb.base.BaseRVHolder;
import com.dinggou.shopjb.base.BaseViewHolder;
import com.dinggou.shopjb.bean.RetailTicketBean;

import java.util.List;

public class RetailTicketAdapter extends BaseRVAdapter {
    public RetailTicketAdapter(Context context, List list) {
        super(context, list);
    }

    @Override
    public int onCreateViewLayoutID(int viewType) {
        return R.layout.item_retail_ticket_list;
    }

    @Override
    public void onBindView(BaseRVHolder holder, int position) {
        BaseViewHolder mHolder = holder.getViewHolder();
        TextView face_value_tv = mHolder.get(R.id.face_value_tv);
        TextView start_time_tv = mHolder.get(R.id.start_time_tv);
        TextView end_time_tv = mHolder.get(R.id.end_time_tv);
        RetailTicketBean bean = (RetailTicketBean)mList.get(position);
        face_value_tv.setText("零售券"+bean.getSum()+"元");
        start_time_tv.setText("发放时间:"+bean.getAdd_date());
        end_time_tv.setText("到期时间:"+bean.getEnd_date());
    }
}
